<template>
  <div>
    <PageHeader :lang="lang" :isShowAnnouncement = "false"></PageHeader>
    <div id="pageBody">
      <div class="article">
        <div class="title">
          <h3>{{agreementContent.Name}}</h3>
          <p v-if="agreementContent.Title">{{agreementContent.Title}}</p>
        </div>
        <div class="cont" v-html ="agreementContent.Context"></div>
      </div>
    </div>
 <PageFooter2 :lang="lang" :langKey="langKey"></PageFooter2>
</div>
</template>
<script>
import commonMixins from '@/mixins/common.js'
import {mapActions} from 'vuex'
export default {
  mixins: [commonMixins],
  data () {
    return {
      agreementContent: '',
      queryLang: ''
    }
  },
  components: {

  },
  watch: {
    langKey () {
      this.langKeyIs()
    }
  },
  methods: {
    ...mapActions([ 'switchLang' ]),
    // 获取隐私内容
    getUserAgreement () {
      this.$http.get('Protocol/GetProtocol', {
        keywords: 'privacyPolicy',
        LanguageType: this.queryLang
      }, {
        isQueryString: true
      })
      .then((res) => {
        if (res) {
          this.agreementContent = res || []
        }
      })
    },
    langKeyIs () {
      if (this.langKey === 'zh-CN' || this.langKey === 'zh-Hant' || this.langKey === 'vi') {
        this.queryLang = this.langKey
      } else {
        this.queryLang = 'en'
      }
      this.getUserAgreement()
    }
  },
  mounted () {
    this.langKeyIs()
    this.getUserAgreement()
  }
}
</script>
